<?php
/**
 * @package		Joomla.Site
 * @subpackage	mod_menu
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access.
defined('_JEXEC') or die;
$catid = JRequest::getVar('catid');
$scat = JRequest::getVar('scat');
$Itemid = JRequest::getVar('Itemid');
?>
<link rel="stylesheet" href="<?php echo JURI::root(); ?>templates/ga/css/tabJquery.css" type="text/css" />
<?php if ($module->showtitle){?>
<h3><?php echo ($module->showtitle) ? $module->title : "";?></h3>
<?php }?>

<div id="tabvanilla" class="widget">
    <ul class="tabnav tabNews">
    <?php	
	foreach ($list as $anItem){		
	//print_r($anItem);exit;
	$class = ($active_id == $anItem->id || $anItem->query['catid'] == $catid) ? 'class="ui-tabs-selected"' : "";
	$mainlinkb = (!empty($anItem->link) || $anItem->type != 'separator') ? "href='".$anItem->link.'&Itemid='.$anItem->id."'" : '';
	?>	
        <li <?php echo $class?>><a class="tabIndex" style="cursor: pointer" <?php echo $mainlinkb?>><span><?php echo $anItem->title?></span></a></li>       
  	<?php }?>
    </ul>            
</div>
<?php 
if ($catid){
	$db	=& JFactory::getDBO();	
	
	$qs = "SELECT * FROM `#__categories` WHERE published = 1 AND parent_id = ".$catid;
	$db->setQuery( $qs );
	$submenub = $db->loadObjectList();
	//print_r($submenub);
	if ($submenub){				
		?>
        <div style="height:5px">&nbsp;</div>		        		        
		<?php
		$sub = 0;
		foreach ($submenub as $item){			
			$sublinkb = (!empty($item->path) || $item->type != 'separator') ? "href='".$item->path."'" : '';
			?>
			<input style="margin-right: -5px;" type="button" onclick="window.location='index.php?option=com_news&view=career&layout=<?php echo $item->alias?>&catid=<?php echo $catid?>&scat=<?php echo $item->id?>&Itemid=<?php echo $Itemid?>'" name="employee" value="<?php echo ucfirst($item->title)?>" class="button subbutton gradient-button<?php echo (($scat == "" && $sub == 0) || $scat == $item->id) ? ' current_active': ''?>" />
			<?php
			$sub++;
		}
		?>
		<?php
	} 
}
?>




